home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws13.zip / PR_OKSRC.PRG < prev    next >
Text File  |  1987-02-16  |  1KB  |  39 lines

  1. * Function PR_OK  : Allows graceful pausing/termination of reports.
  2. * Author          : N. Weicher, Communication Horizons.
  3. * Date            : 11/86.
  4. * Input parameters: none.
  5. * Return value (L): .T. = continue report, .F. = cancel report.
  6. * Description      : see notes in associated article
  7.  
  8. FUNCTION PR_OK
  9. PRIVATE M_REQUEST, M_CONTINUE
  10. M_CONTINUE = .T.                        && assume printing will continue
  11. IF INKEY() = 27                         && escape key pressed
  12.   SET CONFIRM OFF
  13.   M_REQUEST = 0
  14.   @ 24,0 SAY [Printing paused.  0=quit, 1=resume, 2=backup 1 page & resume:] ;
  15.              GET M_REQUEST PICTURE "9" RANGE 0,2
  16.  
  17.   SET ESCAPE OFF            && so Esc bangers don't dump to DOS
  18.   READ
  19.   SET ESCAPE ON
  20.  
  21.   @ 24,0 CLEAR
  22.   DO CASE
  23.   CASE M_REQUEST = 0                    && cancel report
  24.     M_CONTINUE = .F.                    && necessary to stop report
  25.  
  26.   CASE M_REQUEST = 1                    && resume report
  27.     M_CONTINUE = .T.
  28.  
  29.   CASE M_REQUEST = 2                    && backup 20 records, eject page;
  30.     SKIP -20                && tailor this to where/however
  31.     EJECT                && you prefer it to back up
  32.     M_CONTINUE = .T.
  33.  
  34.   ENDCASE
  35. ENDIF
  36. RETURN (M_CONTINUE)
  37.  
  38. * EOS
  39.